/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package programaobf;

import java.io.BufferedInputStream;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;

/**
 *
 * @author Plamen
 */
public class TopCategoriesReport extends Report {

    

    public TopCategoriesReport()
    {
	this.outputFile = new File(this.inputFile.getName() + ".asd");
    }

    public TopCategoriesReport(File inputFile) throws IOException
    {
	super(inputFile);
	//this.outputFile = new File(inputFile.getPath() + ".csv");
    }

    public void saveTopCategories()
    {
	String tmp = "";
	try
	{
	    FileInputStream fis = new FileInputStream(this.inputFile);
	    BufferedInputStream bis = new BufferedInputStream(fis);
	    DataInputStream dis = new DataInputStream(fis);

	    FileWriter fw = new FileWriter(this.outputFile);
	    BufferedWriter out = new BufferedWriter(fw);

	    //
	    // Clear previous contents of file:
	    //
	    FileOutputStream eraseFile = new FileOutputStream(this.outputFile);
	    eraseFile.write((new String()).getBytes());
	    eraseFile.close();
	}
	catch(IOException e)
	{
	    print("Read/Write error: " + e.getMessage());
	}
    }

}
